//引入背景图片
import Background from "../component/Background.js"

//引入logo
import Logo from "../component/Logo.js"

//引入button
import Button from "../component/button.js";

//游戏开始画面 第一个场景
export default class Start{
    constructor(ctx) {
        //一层一层的拿到我们的canvas
        this.ctx = ctx
        this.bg = new Background(this.ctx)
        this.logo = new Logo(this.ctx)
        this.button = new Button(this.ctx)
        this.start = false //表示当前场景没有结束
    }
    render(){

        //状态变更
        this.start = this.button.start //当button被点击true之后，将start状态改成true

        //渲染
        this.bg.render() //先画背景，因为后面写的会挡住前面写的
        this.logo.render() //再画logo
        this.button.render() //再画button
    }
}